package com.teamin.config;

import com.teamin.web.interceptor.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class AppConfig extends WebMvcConfigurerAdapter {

    @Autowired
    LoginInterceptor loginInterceptor;

    /**
     * 配置HttpServletRequest拦截器，排除"/login"
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor).excludePathPatterns("/v1/login", "/health", "/v1/wxserver/**",
                "/user/active/**",
                "/bootstrap/**",
                "/v1/callback/*", "/v1/messages/action/sendcardmessage", "/v1/pcLogin", "/oole", "/swagger/*", "/swagger-resources/configuration/ui", "/swagger-resources"/*, "/circle/netdisk/**", "/v1/circle/**"*/);
    }
}
